package xiegd.com.springbootuse.demo.primarystudy;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Description:
 * @Author: xieguangda
 * @Date: 2021年08月18日 11:06
 */
public class MyStudy {

    public static void main(String[] args) {
        List<Teacher> teacherCodeList = new ArrayList<>();
        teacherCodeList.add(new Teacher());
        List<Student> studentList = new ArrayList<>();
        studentList.add(new Student());
        List unCheckNetCodeList =
                teacherCodeList.stream().filter(str -> !studentList.contains(str)).collect(Collectors.toList());
        System.out.println("我::" + JSONObject.toJSONString(unCheckNetCodeList));
        if (null != unCheckNetCodeList && unCheckNetCodeList.size() > 0) {
            //throw new WarningException(unCheckNetCodeList + “销售机构网点不存在”, “A10037”);
        }
    }
}

@Data
class Teacher{
    private Integer id = 3;
    private String name = "test1";
}

@Data
class Student{
    private Integer id = 2;
    private String name = "test2";
}
